import request from '@/utils/request';
import {AxiosPromise} from 'axios';
import {LiquorRecordsForm, LiquorRecordsQuery, LiquorRecordsVO} from '@/api/biz/liquorRecords/types';

/**
 * 查询白酒记录列表
 * @param query
 * @returns {*}
 */

export const listLiquorRecords = (query?: LiquorRecordsQuery): AxiosPromise<LiquorRecordsVO[]> => {
  return request({
    url: '/biz/liquorRecords/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询白酒记录详细
 * @param id
 */
export const getLiquorRecords = (id: string | number): AxiosPromise<LiquorRecordsVO> => {
  return request({
    url: '/biz/liquorRecords/' + id,
    method: 'get'
  });
};

/**
 * 新增白酒记录
 * @param data
 */
export const addLiquorRecords = (data: LiquorRecordsForm) => {
  return request({
    url: '/biz/liquorRecords',
    method: 'post',
    data: data
  });
};

/**
 * 修改白酒记录
 * @param data
 */
export const updateLiquorRecords = (data: LiquorRecordsForm) => {
  return request({
    url: '/biz/liquorRecords',
    method: 'put',
    data: data
  });
};

/**
 * 删除白酒记录
 * @param id
 */
export const delLiquorRecords = (id: string | number | Array<string | number>) => {
  return request({
    url: '/biz/liquorRecords/' + id,
    method: 'delete'
  });
};
